﻿#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int main()
{
	int num = 0;
	scanf("%d", &num);
	if (num % 3 == 0)
		printf("%d除3的余数是0\n", num);
	else if (num % 3 == 1)
		printf("%d除3的余数是1\n", num);
	else
		printf("%d除3的余数是2\n",num);
	return 0;
}


int main()
{
	int num = 0;
	scanf("%d", &num);
	switch (num % 3)
	{
	case 0:
		printf("%d除3的余数是0\n", num);
		break;
	case 1:
		printf("%d除3的余数是1\n", num);
		break;
	case 2:
		printf("%d除3的余数是2\n", num);
		break;
	default:
		printf("输入错误，请重新输入!\n");
		break;
	}
	return 0;
}


int main()
{
	int day = 0;
	scanf("%d", &day);
	switch (day)
	{
	case 1:		
	case 2:		
	case 3:	
	case 4:		
	case 5:
		printf("工作日\n");
		break;
	case 6:
	case 7:
		printf("节假日\n");
		break;
	default:
		printf("输入错误，请重新输入!\n");
		break;
	}
	return 0;
}


int main()
{
	if(1)
		printf("hehe\n");
	return 0;
}


int main()
{
	while(1)
		printf("hehe\n"); 
	return 0;
}

int main()
{
	int i = 1;
	while (i <= 10)
	{
		printf("%d ", i);
		i++;
	}
	return 0;
}

int main()
{
	int num = 0;
	scanf("%d", &num);
	while (num)
	{
		printf("%d ", num % 10);
		num /= 10;
	}
	return 0;
}

int main()
{
	for (int i = 1; i <= 10; i++)
	{
		printf("%d ", i);
	}
	return 0;
}


int main()
{
	int i = 0;
	int sum = 0;
	for (i = 1; i <= 100; i++)
	{
		if (i % 3 == 0)
		{
			sum += i;
		}
	}
	printf("%d\n", sum);
	return 0;
}

int main()
{
	int i = 0;
	int sum = 0;
	for (i = 3; i <= 100; i+=3)
	{
		if (i % 3 == 0)
		{
			sum += i;
		}
	}
	printf("%d\n", sum);
	return 0;
}


int main()
{
	int i = 1;
	do
	{
		printf("%d ", i);
		i++;
	} while (i<=10);
	return 0;
}


int main()
{
	int count = 0;
	int num;
	scanf("%d", &num);
	do
	{ 
		count++;
		num /= 10;
	} while (num);
	printf("%d", count);
	return 0;
}

int main()
{
	int i = 1;
	while (i <= 3)
	{
		if (i == 2)
		{
			printf("%d\n", i);
			break;
		}
		i++;
	}

	printf("6666");
	return 0;
}

int main()
{
	int i = 1;
	while (i <= 10)
	{
		if (i == 5)
		{
			break;
		}
		printf("%d ", i);
		i++;
	}
	return 0;
}

int main()
{
	int i = 1;
	while (i <= 8)
	{
		if (i == 5)
		{
			i++;
			continue;
		}
		printf("%d ", i);
		i++;
	}
	return 0;
}


int main()
{
	for (int i = 1; i <= 10; i++)
	{
		if (i == 5)
		{
			break;
		}
		printf("%d ", i);
	}
	return 0;
}

int main()
{
	int i = 1;
	for (i = 1; i <= 10; i++)
	{
		if (i == 5)
		{
			continue;
		}
		printf("%d ", i);
	}
	return 0;
}

int main()
{
	int i = 1;
	do
	{
		if (i == 5)
		{
			break;
		}
		printf("%d ", i);
		i++;
	} while (i <= 10);
	return 0;
}

int main()
{
	int i = 1;
	do
	{
		if (i == 5)
		{
			continue;
		}
		printf("%d ", i);
		i++;
	} while (i <= 10);
	return 0;
}

int main()
{
	for (int num = 100; num <= 200; num++)
	{
		//先假设是素数
		int flag = 1;
		//遍历2到自身前一位的数
		for (int i = 2; i <= num - 1; i++)
		{
			//能整除就不是素数，跳出循环。
			if (num % i == 0)
			{
				flag = 0;
				break;
			}
		}
		//遍历完都不能整除 就是素数
		if (flag == 1)
		{
			printf("%d ", num);
		}
	}
	return 0;
}


int main()
{
	goto next;
	printf("hehe\n");
	next:
	printf("haha\n");
	return 0;
}

#include<stdlib.h>
#include<time.h>
int main()
{
	srand((unsigned int)time(NULL));
	printf("%d\n", rand());
	printf("%d\n", rand());
	return 0;
}


void menu()
{
	printf("**********************************\n");
	printf("***********   1.play   ***********\n");
	printf("***********   0.exit   ***********\n");
	printf("**********************************\n");
}

void game()
{
	int r = rand() % 100;
	int count = 5;
	int guess = 0;
	while (count)
	{
		printf("请输入数字:");
		scanf("%d", &guess);
		if (guess > r)
		{
			printf("猜大了\n");
		}
		else if (guess < r)
		{
			printf("猜小了\n");
		}
		else
		{
			printf("恭喜你，猜对了\n");
		}
		count--;
		if (count == 0)
		{
			printf("你失败了，正确值是%d\n", r);
		}
	}
}

int main()
{
	srand((unsigned int)time(NULL));
	int input = 0;
	do
	{
		menu();
		printf("请选择: \n");
		scanf("%d", &input);
		switch (input)
		{
		case 1:
			game();
			break;
		case 0:
			printf("游戏结束...\n");
			break;
		default:
			printf("选择错误，请重新选择:\n");
			break;
		}

	} while (input==0);
}